package com.easylive.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: yudaxian
 * @DateTime: 2024/11/21 21:06
 **/
@AllArgsConstructor
@Getter
public enum UserActionTypeEnum {
    COMMENT_LIKE(0, "like_count", "评论点赞"),
    COMMENT_HATE(1, "hate_count", "评论点踩"),
    VIDEO_LIKE(2, "like_count", "视频点赞"),
    VIDEO_COLLECT(3, "collect_count", "视频收藏"),
    VIDEO_COIN(4, "coin_count", "视频投币"),
    VIDEO_COMMENT(5, "comment_count", "视频评论"),
    VIDEO_DANMU(6, "danmu_count", "视频弹幕"),
    VIDEO_PLAY(7, "play_count", "视频播放"),
    ;

    private Integer type;

    private String field;

    private String desc;

    public static UserActionTypeEnum getByType(Integer type) {
        for (UserActionTypeEnum typeEnum : UserActionTypeEnum.values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
